/* 
 * Copyright [2018] [Alex/libo(liboms@hotmail.com)]
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hyts.restlet.manager;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.restlet.Component;

/** 
 * @title ServerManager.java  
 * @package com.hyts.trestlet.manager  
 * @description TODO  
 * @see TODO
 * @author libo/Alex
 * @email liboms@hotmail.com/liboware@163.com  
 * @date 2018年5月13日 
 * @version V1.0 
 */
public final class ServerManager {

	/**  
	 * <p>服务信息列表</p> 
	 * @fieldName serverInfoList
	 * @fieldType Map<Integer,Component>
	 */ 
	static Map<Integer,Component> serverInfoList = new ConcurrentHashMap<Integer,Component>();
	
	/**  
	 * <b>isConflictPort：是否冲突端口:在一个ip服务器之内</b>
	 * <p>是否冲突端口:在一个ip服务器之内</p>
	 * @param port
	 * @return
	 * @exception
	 */ 
	public static boolean isConflictPort(Integer port){
		if(port == null)
			throw new NullPointerException("获取端口失败：端口为空！");
		return serverInfoList.containsKey(port);
	}
	
}
